<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 'use strict'

        var a = 0;

        console.log(a, window.a); //0,0
        // console.log(window.a)
        if (true) {
            // debugger;

            // console.log(window)
            console.log(a, window.a); //f,0
            a = 'ss'
            console.log(a, window.a); //ss,0
            function a() {};

            // with(window) {
            //     a = 'ss'
            // }//好像是进行了这么个操作
            console.log(a, window.a); //ss,ss
            a = 20;
            console.log(a, window.a); //20,'ss'

        }
        console.log(a, window.a); //ss,ss
    </script>

</body>

</html>